package Thread;

/*
    通过实现Runnable接口来实现多线程
 */
public class RunnableDemo {
    public static void main(String[] args) {
        Thread myThread=new Thread(new MyThread());
        myThread.start();
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+":"+i);
        }
    }
}
class MyThread implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+":"+i);
        }
    }
}
